package com.iknow.db;

import android.content.Context;
import android.database.Cursor;
import com.iknow.User;
import com.iknow.util.StringUtil;

public class UserTable
{
  public static final String CREATE_TABLE = "create table iKnowUser (uid text primary key on conflict replace, password text not null, nick text, email text not null, register text, description text, signature text, image_id text,gender text,user_type text)";
  public static final String DESCRIPTION = "description";
  public static final String EMAIL = "email";
  public static final String GENDER = "gender";
  public static final String IMAGE_ID = "image_id";
  public static final String NICK = "nick";
  public static final String PASSWORD = "password";
  public static final String REGISTER = "register";
  public static final String SINGATURE = "signature";
  public static final String[] TABLE_COLUMNS;
  public static final String TABLE_NAME = "iKnowUser";
  public static final String UID = "uid";
  public static final String USER_TYPE = "user_type";
  private final String TAG = "UserInfoDataBase";
  private Context mContext;

  static
  {
    String[] arrayOfString = new String[10];
    arrayOfString[0] = "uid";
    arrayOfString[1] = "password";
    arrayOfString[2] = "nick";
    arrayOfString[3] = "email";
    arrayOfString[4] = "register";
    arrayOfString[5] = "description";
    arrayOfString[6] = "signature";
    arrayOfString[7] = "image_id";
    arrayOfString[8] = "gender";
    arrayOfString[9] = "user_type";
    TABLE_COLUMNS = arrayOfString;
  }

  public static User parseUser(Cursor paramCursor)
  {
    Object localObject;
    if ((paramCursor == null) || (paramCursor.getCount() == 0))
      localObject = null;
    while (true)
    {
      return localObject;
      User localUser = new User(paramCursor.getString(paramCursor.getColumnIndex("uid")), paramCursor.getString(paramCursor.getColumnIndex("password")), paramCursor.getString(paramCursor.getColumnIndex("email")), StringUtil.formatXMLToString(paramCursor.getString(paramCursor.getColumnIndex("nick"))));
      localUser.setGender(paramCursor.getString(paramCursor.getColumnIndex("gender")));
      localUser.setImgeID(paramCursor.getString(paramCursor.getColumnIndex("image_id")));
      localUser.setIntroduction(StringUtil.formatXMLToString(paramCursor.getString(paramCursor.getColumnIndex("description"))));
      localUser.setSignature(StringUtil.formatXMLToString(paramCursor.getString(paramCursor.getColumnIndex("signature"))));
      localUser.setUserType("0");
      localObject = localUser;
    }
  }
}